#include <stdio.h>
#include <signal.h>
#include <unistd.h>

void print(int signo, siginfo_t *siginfo, void *p)
{
	printf("process ID : %d send the signo : %d\n",siginfo->si_pid,signo);
}

int main()
{
	struct sigaction action = {};
	action.sa_flags = SA_SIGINFO;	//与第14行配对 
	action.sa_sigaction = print;	
	sigaction(SIGINT,&action,NULL);
	sigaction(SIGQUIT,&action,NULL);
	printf("pid = %d\n",getpid());
	while(1);	
}
